﻿using SuperSocket;
using SuperSocket.Channel;

using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
using Xc.DataAccess.Core;
using Xc.DataAccess.Protocoals.WaterMeters.Models;

namespace Xc.DataAccess.Protocoals.WaterMeters.Services
{
    public interface IMeterHandleService
    {
        ConcurrentDictionary<string,IDevcieInfoAppSession> Online { get; }

        ValueTask<bool> ErrorHanle(IDevcieInfoAppSession appSession, PackageHandlingException<MeterFrameRx> packageHandlingException);
        ValueTask OnClose(IDevcieInfoAppSession appSession, CloseEventArgs closeEventArgs);
        ValueTask OnConnect(IDevcieInfoAppSession appSession);
        ValueTask PackageHandle(IDevcieInfoAppSession appSession, MeterFrameRx meterFrameRx);
        ValueTask<ResultData<TData, byte[]>> AfterRequest<TData>(TData data) where TData : MeterFrameTxBase;
    }
}